<?php
// populate two lists - $this->prereg_cases and $this->pending_cases
// neat way would be to include two Dojo ContentPanes.  heirarchy is
// form (action = /keystone/VAS/index/matchpreregcases)
//   content pane 1 with prereg cases, each with checkmark 
//   content pane 2 with pending & finished cases
 ?>
<div class="section_content">
<form method="POST" action="/index/fdmatchpreregcases">

<table border=0 cellpadding=5 width=100%>
<tr>
<td style='width:50%;vertical-align:top'>
Pre-Registration Cases<p>
<?php
if(count($this->preregCases)<1)
{
	echo "No pre-registration cases were found for this branch";
}
else
{
	foreach( $this->preregCases as $preregCase )
	{
		$caseid = $preregCase['id'];
		$decedent_fname = $preregCase['decedent_fname'];
		$decedent_mname = $preregCase['decedent_mname'];
		$decedent_lname = $preregCase['decedent_lname'];
		$decedent_city = $preregCase['decedent_city'];
		$decedent_state = $preregCase['decedent_state'];
		$decedent_dob = $preregCase['decedent_dob'];
		
		echo "<span class=\"prereg_decedent\">";
		echo "<input type=checkbox name=\"preregcases[]\" value=\"$caseid\">";
		echo " Decedent: <strong>$decedent_fname $decedent_mname $decedent_lname</strong><br>";
		echo " Location: <strong>$decedent_city $decedent_state</strong><br>";
		echo "</span><p>";
	}
}
 ?>
</td>
<td>
Pending and Finished Cases<p>
<?php
echo "Pending Cases:<br>";
if( count($this->pendingCases) < 1 )
{
	echo "No pending cases found for this FD<br>";
}
else
{
	foreach( $this->pendingCases as $pendingCase )
	{
		$FDMS_case_num = $pendingCase['FDMS_case_num'];
		$decedent_fname = $pendingCase['decedent_fname'];
		$decedent_mname = $pendingCase['decedent_mname'];
		$decedent_lname = $pendingCase['decedent_lname'];
		$decedent_city = $pendingCase['decedent_city'];
		$decedent_state = $pendingCase['decedent_state'];
		$decedent_dob = $pendingCase['decedent_dob'];
		
		echo "<span class=\"submitted_decedent\">";
		echo " Decedent: <strong>$decedent_fname $decedent_mname $decedent_lname</strong><br>";
		echo " Location: <strong>$decedent_city $decedent_state</strong><br>";
		echo "</span>";
	}
}

echo "<br>Finished Cases:<br>";
if( count($this->finishedCases) < 1 )
{
	echo "No finished cases found for this FD<br>";
}
else
{
	foreach( $this->finishedCases as $finishedCase )
	{
		$FDMS_case_num = $finishedCase['FDMS_case_num'];
		$decedent_fname = $finishedCase['decedent_fname'];
		$decedent_mname = $finishedCase['decedent_mname'];
		$decedent_lname = $finishedCase['decedent_lname'];
		$decedent_city = $finishedCase['decedent_city'];
		$decedent_state = $finishedCase['decedent_state'];
		$decedent_dob = $finishedCase['decedent_dob'];
		
		echo "<span class=\"finished_decedent\">";
		echo " Decedent: <strong>$decedent_fname $decedent_mname $decedent_lname</strong><br>";
		echo " Location: <strong>$decedent_city $decedent_state</strong><br>";
		echo "</span>";
	}
}
?>
</td>
</tr>
</table>
<div style="width:100%; text-align: right;"><input type=submit></div><br><br>

</form>
</div>
